#!/bin/bash

dir_path=$(pwd)

find ${dir_path} -name "*.md" | while read file
do
    file_name=$(basename "${file}" .md)
    
    dir_name=$(dirname "${file}")
    
    cd "${dir_name}"
    python3 $dir_path/md.py "${file_name}"
    cd -
done

#find ./ -name '*.html' -print0 | xargs -0 rm -rf



find . -type f | while read file; do
  if [[ "${file##*.}" != "html" ]]; then
    echo "Deleting $file"
    rm "$file"
  fi
done

